#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QVBoxLayout>
#include <QClipboard>

#include "qtexteditorplus.h"
#include "textparser.h"
#include "configmanager.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
private slots:
    void editorPlus_textChanged();

    void on_clear_btn_clicked();

    void on_flush_device_info_clicked();

    void on_copy_btn_clicked();

private:
    enum device_type{
        PC = 0,
        HOST = 1,
        MOBILE = 2
    };
    enum device_raw_type{
        IOS = 0,
        ANDROID = 1
    };
    Ui::MainWindow *ui;
    QTextEditorPlus *editorPlus;
    TextParser *textparser;

    int device_raw_type;
    void InitComponent();
    void InitInfoGroup();
    ConfigManager* config;
    void fetchInfo(QMap<QString, QString> fetchData);

    QString generateReport(int deviceType, bool isGameProblem);
    void appendCommonPCFields(QStringList &fields);
    void appendCommonHostFields(QStringList &fields, bool isGameProblem);
    void appendCommonMobileFields(QStringList &fields, bool isGameProblem);

};
#endif // MAINWINDOW_H
